<template>
  <div>
    <h2>user</h2>
    <div class="box">
      <h2 ref="count1Ref" class="count-up-num">{{ number }}</h2>
    </div>
  </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { CountUp } from 'countup.js'

const count1Ref = ref<HTMLElement>()
const number = ref(12333333)
const options = {
  decimalPlaces: 2,
  prefix: '¥'
}
onMounted(() => {
  const count = new CountUp(count1Ref.value!, number.value, options)
  count.start()
})
</script>

<style scoped>
.box {
  min-height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

h2 {
  font-size: 100px;
  color: red;
}
</style>
